package com.example.androidcompletesec.fragment;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;

import com.example.androidcompletesec.R;

public class ListDialogFragment extends DialogFragment {
	NoticeDialogListener mListener; 
	public void onAttach(Activity activity) { 
		super.onAttach(activity); 
		try { mListener = (NoticeDialogListener) activity; 
		} catch (ClassCastException e) { 
			String msg = " must implement NoticeDialogListener"; 
			throw new ClassCastException(activity.toString() + msg); 
		} 
	}
//	public Dialog onCreateDialog(Bundle savedInstanceState) { 
//		return new AlertDialog.Builder(getActivity())
//		.setIcon(R.drawable.ic_launcher)
//		.setTitle(bundle.getString("음식을 선택하시오.")) 
//		.setItems(R.array.fruits, new OnClickListener() { 
//			public void onClick(DialogInterface dialog, int which) { 
//				String[] fruits = getResources().getStringArray(R.array.fruits); 
//				mListener.onDialogClick(ListDialogFragment.this, fruits[which]); 
//			}
//		}) 
//		.setNegativeButton("취소",null) .create(); 
//	} 
	
	public interface NoticeDialogListener { 
		public void onDialogClick(DialogFragment dialog, String res); 
	}
}
